Skip to content

Do not keep refs to submodules internally#45889

Open
Cyrilvallez wants to merge 3 commits into
mainfrom
fix-refs
Open

Do not keep refs to submodules internally#45889
Cyrilvallez wants to merge 3 commits into
mainfrom
fix-refs

Conversation

@Cyrilvallez
Copy link
Copy Markdown
Member

What does this PR do?

As per the title. The comment claims to save compute by caching the property, but as it's called on EVERY CHILD in post_init, we actually traverse the entire graph for every child, instead of traversing it only once during conversion search.

Also, keeping internal refs to submodules themselves is IMO a bad idea in general (the property contains both the string AND the module itself)

cc @yonigozlan @ArthurZucker

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@github-actions
Copy link
Copy Markdown
Contributor

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=45889&sha=f1e81a

@yonigozlan
Copy link
Copy Markdown
Member

yonigozlan commented May 11, 2026

Yes not sure it's that useful anyway, + it was causing some issues in downstream libs (peft), I don't feel strongly about keeping it, unless you think it could really be useful down the line @ArthurZucker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants